package Try;

import java.io.File;
import java.text.DecimalFormat;

public class Main19 {
    public static void main(String[] args) {

//        String format = "000000";
//        DecimalFormat df;

        File f = new File("E:\\Picture\\clean_research\\pictures");
        File[] subFiles = f.listFiles();

        for (File ff:subFiles){
            File[] subFFiles = ff.listFiles();
            String format = "000000";
            DecimalFormat df = new DecimalFormat(format);
            int woid = 1;
            int manid = 1;
            for (File fff:subFFiles){
                if(fff.getName().contains("0")){
                    System.out.println(fff.getName());
                    if(fff.getName().contains("women")){
//                        System.out.println(fff.getParentFile().getAbsolutePath());
                        fff.renameTo(new File(fff.getParentFile().getAbsolutePath()+"\\women"+"\\"+df.format(woid)));
                        woid++;
                    }else if(fff.getName().contains("man")){
                        fff.renameTo(new File(fff.getParentFile().getAbsolutePath()+"\\man"+"\\"+df.format(manid)));
                        manid++;
                    }

                }
//                System.out.println();
//                File[] subFFFiles = fff.listFiles();

//                for (File ffff:subFFFiles){
//                    System.out.println(ffff.getParentFile().getAbsolutePath()+df.format(id));
//                    id++;
//                    ffff.renameTo(new File(ffff.getParentFile().getAbsolutePath()+df.format(id)));
//                    File[] subFFFFiles = ffff.listFiles();
//                    for (File fffff:subFFFFiles){
//                        ;
//                    }
//                }
            }
        }
    }
}
